package utilidades.tags;

import java.io.IOException;
import java.util.Date;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;

public class StaticTag extends TagSupport
{
	private String	text;
	private	String	value;

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public int doStartTag() throws JspTagException {
		return EVAL_BODY_INCLUDE;
	}

	public int doEndTag() throws JspTagException {
		JspWriter out = pageContext.getOut();

		try {
			out.write("<tr>");
			out.write("<td class=leyenda>");
			out.write(text);
			out.write("</td>");
			out.write("<td class=dato>");
			if (value!=null)
				out.write(value);
			else
				out.write("&nbsp;");
			out.write("</td>");
			out.write("</tr>\n");
		}
		catch (IOException ex) {
			throw new JspTagException("Error en tag Static");
		}

		return EVAL_PAGE;
	}
}
